extends layout

include _includes/sharedHTMLfunctions

block content
  .row.page-header
    .col-lg-12
      h1= pageHeader.title
  .row
    .col-xs-12.col-md-9
      .row
        .col-xs-12.col-sm-6
          p.rating
            +outputRating(location.rating)
          p= location.address
          .panel.panel-primary
            .panel-heading
              h2.panel-title Opening Hours
            .panel-body
              each time in location.openingTime
                p
                  | #{time.days} :
                  if time.closed
                    | closed
                  else
                    |#{time.opening} - #{time.closing}
          .panel.panel-primary
            .panel-heading
              h2.panel-title Facilities
            .panel-body
              each facility in location.facilities
                span.label.label-warning
                  span.glyphicon.glyphicon-ok
                    | &nbsp;#{facility}
                | &nbsp;
        .col-xs-12.col-sm-6.location-map
          .panel.panel-primary
            .panel-heading
              h2.panel-title Location map
            .panel-body
              img.img-responsive.img-rounded(src='http://api.map.baidu.com/staticimage?width=500&height=400&center=#{location.coords.lng},#{location.coords.lat}&zoom=15&markers=#{location.coords.lng},#{location.coords.lat}&markerStyles=l')
      .row
        .col-xs-12
          .panel.panel-primary.review-panel
            .panel-heading
              a.btn.btn-default.pull-right(href='/location/#{location._id}/review/new') Add review
              h2.panel-title Customer reviews on #{location.name}
            .panel-body.review-container
              if noReview
                .row.error
                  .col-xs-offset-1.col-xs-10 #{noReview}
              else
                each review in location.reviews
                  .row
                    .review
                      .well.well-sm.review-header
                        span.rating
                          +outputRating(review.rating)
                        span.review-author #{review.author}
                        small.review-timestamp
                          +formatDate(review.createdOn)
                      .col-xs-12
                        p !{review.reviewText.replace(/\n/g,'<br />')}
    .col-xs-12.col-md-3
      p.lead #{location.name} #{sidebar.context}
      p= sidebar.callToAction



